package com.goods.shop.service.third;

import com.goods.shop.service.model.third.OrderModel;
import com.goods.shop.service.model.third.OrderTaskModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.concurrent.CountDownLatch;

public class BigGaoThread extends Thread{
    protected static Logger logger= LogManager.getLogger(LogManager.ROOT_LOGGER_NAME);
    private BiGaoService service;
    private OrderModel order;
    private OrderTaskModel taskModel;
    private CountDownLatch latch;

    public BigGaoThread(OrderModel order,OrderTaskModel taskModel,BiGaoService service,CountDownLatch latch) {
        this.service=service;
        this.order=order;
        this.taskModel=taskModel;
        this.latch=latch;
    }
    public void run(){
        service.execute(order,taskModel);
        latch.countDown();
        logger.info("latch={}",latch.getCount());
    }
}
